# -*- coding: utf-8 -*-

"""
@Remark: 公共基础model类
"""
import uuid

from django.apps import apps

from django.db import models

from chenze import settings


class CoreModel(models.Model):
    remark = models.CharField(max_length=100, verbose_name="备注", null=True, blank=True, help_text="备注")
    # dept_belong_id = models.CharField(max_length=100, help_text="数据归属部门", null=True, blank=True, verbose_name="数据归属部门")
    creator = models.ForeignKey(to=settings.AUTH_USER_MODEL, related_query_name='creator_query', null=True,
                                verbose_name='创建人', help_text="创建人", on_delete=models.SET_NULL, db_constraint=False)
    modifier = models.CharField(max_length=100, null=True, blank=True, help_text="修改人", verbose_name="修改人")
    update_datetime = models.DateTimeField(auto_now=True, null=True, blank=True, help_text="修改时间", verbose_name="修改时间")
    create_datetime = models.DateTimeField(auto_now_add=True, null=True, blank=True, help_text="创建时间",
                                           verbose_name="创建时间")
    deleted = models.BooleanField(default=False, verbose_name='是否删除')

    class Meta:
        abstract = True
        verbose_name = '核心模型'
        verbose_name_plural = verbose_name
